/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bff.bjj.ui.component;

import java.awt.Dimension;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import javax.swing.JList;
import javax.swing.JPanel;

/**
 *
 * @author Bill
 */
public abstract class BJJResizeListPanel extends JPanel implements ComponentListener {


    protected static final int DEFAULT_SIZE = 300;

    public BJJResizeListPanel(JList list) {
        list.addComponentListener(this);
    }

    public abstract void adjustComponent(Dimension size);

    @Override
    public void componentResized(ComponentEvent e) {
        adjustComponent(e.getComponent().getSize());
    }

    @Override
    public void componentMoved(ComponentEvent e) {
        
    }

    @Override
    public void componentShown(ComponentEvent e) {
        
    }

    @Override
    public void componentHidden(ComponentEvent e) {

    }
}
